package chapter01

import "fmt"

func TestArr() {
	//var a [3]int
	//var b [4]int
	//
	//fmt.Println(a)
	//fmt.Println(b)

	//var cityArr = [2]string{"beijing","shanghai"}
	//fmt.Println(cityArr)
	//
	//var boolArr = [...]bool{true,false,true,false}
	//fmt.Println(boolArr)
	//
	//var langArr = [...]string{1:"a",3:"d",7:"d"}
	//
	//fmt.Println(langArr)
	//
	//fmt.Printf("%T\n",langArr)
	//
	//for i := 0; i < len(cityArr); i++ {
	//	fmt.Println(cityArr[i])
	//}
	//
	//for _, s := range cityArr {
	//	//fmt.Println(i)
	//	fmt.Println(s)
	//}

	//cityArr :=[5][2]string{
	//	{"a","b"},
	//	{"c","d"},
	//	{"e","f"},
	//	{"g","k"},
	//	{"l","m"},
	//}
	//fmt.Println(cityArr)
	//
	//for _, v1 := range cityArr {
	//	for _, s := range v1 {
	//		fmt.Println(s)
	//	}
	//}
	arr := [5]int{1, 3, 5, 7, 8}

	//var sum = 0
	//
	//for _, x := range arr {
	//	sum = sum+x
	//}
	//fmt.Println(sum)

	//a :=[...][2]int{}
	for x, i2 := range arr {

		for i := x + 1; i < len(arr)-1; i++ {
			if arr[i]+i2 == 8 {
				fmt.Println(x, i)
			}
		}

	}

}
